Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: treat CTRL + J as Enter #832

Conversation

ErichDonGubler
Copy link

@ErichDonGubler ErichDonGubler commented Sep 24, 2024

This resolves the issue I noted having in nushell/nushell#6427 (comment), where hitting Enter in MacOS and Linux outside the main Reedline::read_line call in raw mode results in a CTRL + J event that yields no actual input once read_line is called again.

I'm not positive that this doesn't introduce regressions with, e.g., pasted input. I'm not sure what the best way to test this would be.

I'm also not sure if it resolves that issue in its entirety, since the question of whether its scope should include \n is unresolved.

@sholderbach
Copy link
Member

I don't think hardcoding the binding like this is the right move, even if I can see it being part of the default binding. If you use the kitty keyboard extensions it may be possible to bind the true Ctrl-j then you probably want the ability to rewire it.

@ErichDonGubler
Copy link
Author

I use Wezterm, so maybe there's some configuration I need to investigate there. I'm not currently aware of a way to rebind keys like that in Wezterm, but admittedly I haven't looked.

@ErichDonGubler
Copy link
Author

Thinking about this, IIRC editors like Neovim are often interested in exposing CTRL + J as a separate binding from Enter. I don't know if those sorts of applications are interested in using reedline, but I suppose it does mean that maybe applications should be on the hook for dealing with the distinction.

The application I want to "fix" this in is Nushell; perhaps I should contribute there instead? It is my observation elsewhere that Nushell understands that it's receiving a CTRL + J.

@ErichDonGubler
Copy link
Author

Ah, looks like I can resolve this with Nushell configuration: nushell/nushell#6427 (comment)

🫡 Guess I'm done here, sorry for the noise!

@ErichDonGubler ErichDonGubler deleted the erichdongubler/push-qvutoltkxyty branch October 5, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants